package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.LoaiTruyenChuDao;
import com.truyen.persistence.entity.LoaiTruyenChu;
import com.truyen.service.LoaiTruyenChuService;
import com.truyen.utils.PagingInfo;


@Service
public class LoaiTruyenChuServiceImpl implements LoaiTruyenChuService {
	
	@Autowired
	private LoaiTruyenChuDao loaiTruyenChuDao;

	@Override
	public void save(LoaiTruyenChu entity) {
		loaiTruyenChuDao.save(entity);
	}

	@Override
	public LoaiTruyenChu findById(Long id) {
		return loaiTruyenChuDao.findById(id);
	}

	@Override
	public List<LoaiTruyenChu> getAll() {
		return loaiTruyenChuDao.findAll();
	}

	@Override
	public LoaiTruyenChu findByProperty(String column, Object value) {
		List<LoaiTruyenChu> lst = loaiTruyenChuDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<LoaiTruyenChu> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return loaiTruyenChuDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}

	@Override
	public List<LoaiTruyenChu> getLstAllWithPagingInfo(PagingInfo pInfo) {
		return loaiTruyenChuDao.getLstAllWithPagingInfo(pInfo);
	}

	@Override
	public LoaiTruyenChu findByAliasVType(String alias, int type) {
		return loaiTruyenChuDao.findByAliasVType(alias,type);
	}

	@Override
	public List<LoaiTruyenChu> getLstAllWithPagingInfo(PagingInfo pInfo,
			int type) {
		return loaiTruyenChuDao.getLstAllWithPagingInfo(pInfo,type);
	}


}
